﻿<div ng-controller="app.views.usermanage as vm" ng-init="selectTenant(tenantId)">
    <div class="container">
        <!-- BEGIN PAGE BREADCRUMB -->
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <a href="#/">主页</a><i class="fa fa-circle"></i>
            </li>
            <li>
                <a href="#">系统设置</a>
                <i class="fa fa-circle"></i>
            </li>
            <li>
                <a href="#/UserManage">用户管理</a>
                <i class="fa fa-circle"></i>
            </li>
            <li class="active">
                管理指定租户下的用户
            </li>
        </ul>
        <!-- END PAGE BREADCRUMB -->
        <!-- BEGIN PAGE CONTENT INNER -->
        <div class="portlet light">
            <div class="portlet-body">

                <div class="row">
                    <div ng-include="'/App/Main/views/TenantManage/TenantSelect.cshtml'"></div>

                    <div ng-class="session.tenant!=null?'col-md-12':'col-md-8'">
                        <!-- BEGIN Portlet PORTLET-->
                        <div class="portlet light bordered">
                            <div class="portlet-title tabbable-line">
                                <div class="caption">
                                    <i class="icon-pin font-yellow-lemon"></i>
                                    <span class="caption-subject bold font-yellow-lemon uppercase">
                                        用户管理
                                    </span>
                                    <span class="caption-helper">管理租户的用户</span>
                                </div>
                                <div class="actions">
                                    <a data-target="#stack1" data-toggle="modal" class="btn default yellow-stripe">
                                        <i class="fa fa-plus"></i>
                                        <span class="hidden-480">
                                            新建用户
                                        </span>
                                    </a>
                                </div>
                            </div>
                            <div class="portlet-body">
                                @*<div class="table-container">
                                    <div class="table-actions-wrapper">
                                        <span>
                                        </span>
                                        <select class="table-group-action-input form-control input-inline input-small input-sm">
                                            <option value="">Select...</option>
                                            <option value="true">启用</option>
                                            <option value="false">停用</option>
                                        </select>
                                        <button class="btn btn-sm yellow table-group-action-submit"><i class="fa fa-check"></i> Submit</button>
                                    </div>*@
                                <table class="table table-striped table-bordered table-hover" id="datatable_ajax">
                                    <thead>
                                        <tr role="row" class="heading">
                                            <th width="2%">
                                                标志
                                            </th>

                                            <th width="8%">
                                                名称
                                            </th>

                                            <th width="15%">
                                                创建时间
                                            </th>
                                            <th width="8%">
                                                是否默认
                                            </th>
                                            <th width="8%">
                                                用户级别
                                            </th>
                                            <th width="8%">
                                                操作
                                            </th>
                                        </tr>
                                    </thead>

                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>
    </div>
    <!-- END PAGE CONTENT INNER -->
    <div id="stack1" class="modal fade" tabindex="-1" data-focus-on="input:first">
        <form action="javascript:;" class="form-horizontal" name="userForm" ng-submit="submit()">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
                <h4 class="modal-title">用户信息编辑</h4>
            </div>
            <div class="modal-body">

                <div class="form-body">
                    <div class="form-group">
                        <input type="hidden" name="tenantId" ng-model="userModel" ng-bind="tenantId" />
                        <label class="col-md-3 control-label">用户名</label>
                        <div class="col-md-4">
                            <input type="text" name="name" ng-model="userModel.name" required ng-minlength="2" ng-maxlength="50" class="form-control" placeholder="名称">
                            <span class="has-error" ng-show="userForm.name.$error">
                                <span ng-show="userForm.name.$error.minlength" class="help-block">该字段太短了.</span>
                                <span ng-show="userForm.name.$error.maxlength" class="help-block">该字段太长了.</span>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">昵称</label>
                        <div class="col-md-4">
                            @*<div class="input-group">*@
                            <input type="text" name="surname" ng-model="userModel.surname" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                            <span class="has-error" ng-show="userForm.surname.$error">
                                <span ng-show="userForm.surname.$error.minlength" class="help-block">该字段太短了.</span>
                                <span ng-show="userForm.surname.$error.maxlength" class="help-block">该字段太长了.</span>
                            </span>
                            @*</div>*@
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">登录名</label>
                        <div class="col-md-4">
                            @*<div class="input-group">*@
                            <input type="text" name="userName" ng-model="userModel.userName" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                            <span class="has-error" ng-show="userForm.userName.$error">
                                <span ng-show="userForm.userName.$error.minlength" class="help-block">该字段太短了.</span>
                                <span ng-show="userForm.userName.$error.maxlength" class="help-block">该字段太长了.</span>
                            </span>
                            @*</div>*@
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">邮箱</label>
                        <div class="col-md-4">
                            @*<div class="input-group">*@
                            <input type="text" name="emailAddress" ng-model="userModel.emailAddress" required ng-minlength="2" ng-maxlength=50 class="form-control" placeholder="租户名字">
                            <span class="has-error" ng-show="userForm.emailAddress.$error">
                                <span ng-show="userForm.emailAddress.$error.minlength" class="help-block">该字段太短了.</span>
                                <span ng-show="userForm.emailAddress.$error.maxlength" class="help-block">该字段太长了.</span>
                            </span>
                            @*</div>*@
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">邮箱验证过</label>
                        <div class="col-md-4">
                            <select ng-model="userModel.isEmailConfirmed" name="isEmailConfirmed" required ng-options="state.id as state.text for state in states" class="form-control"></select>
                            <span class="has-error" ng-show="userForm.isActive.$error">
                                <span ng-show="userForm.isEmailConfirmed.$error.required" class="help-block">该字段必选.</span>
                            </span>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-md-3 control-label">是否激活</label>
                        <div class="col-md-4">
                            <select ng-model="userModel.isActive" name="isActive" required ng-options="state.id as state.text for state in states" class="form-control"></select>
                            <span class="has-error" ng-show="userForm.isActive.$error">
                                <span ng-show="userForm.isActive.$error.required" class="help-block">该字段必选.</span>
                            </span>
                        </div>
                    </div>
                    <div class="form-actions">
                        <div class="row">
                            <div class="col-md-offset-3 col-md-9">
                            </div>
                        </div>
                    </div>
                </div>

            </div>
            <div class="modal-footer">

                <button type="submit" class="btn green" ng-disabled="userForm.$invalid">保存</button>
                <button type="button" data-dismiss="modal" class="btn default">取消</button>



            </div>
        </form>
    </div>
</div>


